| CreateObject: COM Object |
|
 |
| Description
|
|
The CreateObject function can create a Component Object Model (COM) object.
|
To create a COM object, you must provide this information:
- The object's program ID or filename
- The methods and properties available to the object through the IDispatch interface
- The arguments and return types of the object's methods
|
For most objects, you can get this information from the OLEView utility.
| Note: |
On UNIX, this function does not support COM objects. |
|
| |
| Returns
|
|
A COM object.
|
| |
| Function syntax |
CreateObject(type, class, context, serverName)
|
| |
| See also
|
|
ReleaseComObject, cfobject
|
| |
| Usage
|
The following example creates the Windows Collaborative Data Objects (CDO) for NTS NewMail object to send mail. You would use this code within a cfscript tag.
Mailer = CreateObject("COM", "CDONTS.NewMail");
|
|
For more information, see Chapter 34, "Integrating COM and CORBA Objects in CFML Applications," in Developing ColdFusion MX Applications.
|